package com.xsh.gls.controller;


import com.xsh.gls.interceptor.MyHandlerInterceptor;
import com.xsh.gls.pojo.User;
import com.xsh.gls.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@RestController
public class TestController extends MyHandlerInterceptor {
    @Autowired
    private UserService userService;

    @RequestMapping("/test")
    public Object hello(Integer id, HttpServletResponse response, HttpServletRequest request){

        User user=null;
        try {
            user =  userService.queryUserById(id);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return user;
    }
}
